<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<script type="text/javascript">
			window.onload = function(){
				var p = document.getElementsByTagName('p');
				//获取标签内文本内容
				if(document.all){
						//IE浏览器
						var content = p[0].innerText+'<br>IE';
					}else{
						//W3C浏览器
						var content = p[0].textContent+'<br>W3C';
					}
					alert(content);
			}
		</script>
	</head>
	<body>
		<p>我是p标签</p>
	</body>
</html>
